home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Utilities / Programming / CTools 2.2.1d / CTools / CTools.rsrc / TEXT_150_Func. Pop Up.txt < prev    next >
Encoding:
Text File  |  1995-12-01  |  2.1 KB  |  47 lines

  1. Function Pop-Up:
  2.  
  3. The first goal in editing is to get all the routines to show up in the "Function Pop-Up" menu.  This is so you will know you‚Äôve got whole routines to End Of File, and also for faster navigation.  If you don‚Äôt do this first, they will just be extra compiler errors later.
  4.  
  5. For all routines to so appear in the popup, there must be an equal number of start and end braces, and no ‚Äúnested functions.‚Äù
  6.  
  7. CTools‚Ñ¢ only converts the ‚Äúvar‚Äù and first ‚Äúbegin‚Äù in place.  It eats ‚Äúvar‚Äù and changes ‚Äúbegin‚Äù into a begining brace.  Since Pascal is ‚Äúbackward‚Äù, these begining braces are in the wrong place - after the variables.  This is relatively easy to remedy.
  8.  
  9. Find:
  10.  
  11. )<CR>   // (right paren, return)
  12.  
  13. and replace with:
  14.  
  15. )<CR>{  // (right paren, return, left brace)
  16.  
  17. Do this manually using Command G and/or Command H, so you can SEE what you are changing.  Automatic ("Replace All") will create the need for extra editing by doing it to ALL routines!  You don‚Äôt want to do it to routines - only prototypes.
  18.  
  19. Before dealing with the, now, extra brace, you MUST replace the:
  20.  
  21. };
  22.  
  23. with:
  24.  
  25. }
  26.  
  27. You can use the Replace All command for this one.  This is done to prevent interference with the next two editing steps without eating your start braces on nested functions.
  28.  
  29. Still cleaning up the extra start braces, you‚Äôll find two situations:
  30. (1) The extra begin brace is after a line ending in a comment.
  31. (2) The extra begin brace is after a line ending in ‚Äò;‚Äô.
  32.  
  33. In either case, there may be one or more carriage returns, then one or more TABs, before the brace.  If there‚Äôs one RETURN and one TAB, Find:
  34.  
  35. ;
  36.     {    // (semicolon, return, tab, left brace)
  37.  
  38. and replace with:
  39.  
  40. ;
  41.        // (semicolon, return)
  42.  
  43. You may have to add TABs and RETURNs as needed, depending on the variety of indents and returns carried over from the Pascal.
  44.  
  45. On this last one, the only thing that will prevent you from getting them all is a comment after the ';' in the first line.  To find these, use the Function Pop Up.  The extra brace will be in the bottom one on the list or in the routine just below it.
  46.  
  47.